<template>
  <div class="box">
    <el-divider content-position="center">千分位</el-divider>
    <div>{{ num | thousands }}</div>

    <el-divider content-position="center">数字转换为大写</el-divider>
    <div>{{ money | RMBcapital }}</div>

    <el-divider content-position="center">隐藏数位</el-divider>
    <div>{{ phone | plusXing(3,4) }}</div>
    <div>{{ idCard | plusXing(6,4) }}</div>

    <el-divider content-position="center">缺省值</el-divider>
    <div>{{ dataVal | defaultVal }}</div>

    <el-divider content-position="center">自定义loading</el-divider>
    <el-button v-preventReClick type="primary" @click="testLoading">自定义loading</el-button>
  </div>
</template>

<script>
import { Loading } from 'element-ui'

export default {
  name: 'Mixin',
  data() {
    return {
      num: 154859625,
      money: 9999999.999,
      dataVal: '',
      phone: '15641783308',
      idCard: '15042819881212451X'
    }
  },
  methods: {
    // 测试Loading
    testLoading() {
      let loading = Loading.service({
        lock: true,
        text: '',
        spinner: 'el-icon-my-loading',
        background: 'hsla(0,0%,100%,.8)'
      })
      setTimeout(() => {
        loading.close()
      }, 2000)
    }
  }
}
</script>

<style scoped>

</style>
